﻿@using SDF.Core;
@using SDF.Core.Infrastructure
@using SDF.Web.Framework.Themes
@using SDF.Web.Framework.UI
@{  
    var supportRtl = EngineContext.Current.Resolve<IWorkContext>().WorkingLanguage.Rtl;
    var themeName = EngineContext.Current.Resolve<IThemeContext>().WorkingThemeName;

    //add browser specific CSS files
    var browser = Request.Browser;
    if (browser.Browser == "IE" && browser.MajorVersion == 8)
    {
        Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/css/ie8.css", themeName));
    }
    //add main CSS file
    if (supportRtl)
    {
        Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/css/styles.rtl.css", themeName));
    }
    else
    {
        Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/css/styles.css", themeName));
    }
    
    //add jQuery UI css file
    Html.AppendCssFileParts("~/Content/jquery-ui-themes/smoothness/jquery-ui-1.10.3.custom.min.css");

    if (browser.Browser == "IE" && browser.MajorVersion == 8)
    {
        Html.AddScriptParts("~/Scripts/selectivizr.min.js");
        Html.AddScriptParts("~/Scripts/respond.min.js");
    }
}